package com.tanhua.server.controller;

import com.tanhua.model.vo.PeachVo;
import com.tanhua.server.service.BlossomService;
import org.apache.tomcat.util.net.AprEndpoint;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
@RequestMapping("/peachblossom")
public class BlossomController {
    @Autowired
    private BlossomService blossomService;

    @PostMapping ()
    private ResponseEntity ResponseEntity(MultipartFile soundFile ) throws IOException {
        blossomService.send(soundFile);
        return ResponseEntity.ok(null);
    }
    @GetMapping ()
    private ResponseEntity jsr() throws IOException {
      PeachVo peachVo = blossomService.jieshou();
        return ResponseEntity.ok(peachVo);
        }

 }
